<template>
    <div>
        <h3>v-if指令做条件渲染</h3>
        <button @click="opnebtn">点击开关</button>
        <div v-if="open">
            <p v-if="age >= 18">去网咖冲浪</p>
            <p v-else-if="age >=16">去电影院看电影</p>
            <p v-else>回家写作业</p>
        </div>
    </div>
</template>

<script setup lang="ts">
import {ref} from 'vue'
const age = ref(17)
const open = ref(false)
const opnebtn = () => {
    console.log(123);
    
    open.value = !open.value
}
</script>

<style scoped>

</style>